package com.lagou.homeWork;

public class Coder {

    //定义成员变量
    private int id;
    private String name;
    private double salary;

    //定义空构造
    public Coder() {
    }

    //定义有参构造
    public Coder(int id, String name, double salary) {
        setId(id);
        setName(name);
        setSalary(salary);
    }

    //定义 getter setter 方法访问成员变量
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }

    //定义行为 work 方法
    public void work(){
        System.out.println("工号为"+id+"工资为"+salary+"的程序员"+name+"正在努力写着代码");
    }

}
